/**
 * ReportGear(2011)
 */
package com.reportgear.report.view.grid.editor.impl;

import java.awt.BorderLayout;
import java.awt.Component;

import javax.swing.BorderFactory;
import javax.swing.SwingUtilities;

import com.reportgear.core.swing.pane.base.EditorPane;
import com.reportgear.report.model.cell.value.salary.SalaryItemObject;

/**
 * 工资定制编辑面板
 * 
 * @version 1.0 2011-3-26
 * @author <a herf="lexloo@gmail.com">lexloo</a>
 * @since Report 1.0
 */
public class SalaryItemObjectEditPane extends EditorPane<SalaryItemObject> {
	/**
	 * UID
	 */
	private static final long serialVersionUID = -3754490751585372228L;
	private SalaryItemPane salaryItemPane;

	public SalaryItemObjectEditPane() {
		this.setBorder(BorderFactory.createEtchedBorder());
		this.setLayout(new BorderLayout());

		this.salaryItemPane = new SalaryItemPane();
		this.add(this.salaryItemPane);
	}

	@Override
	public void populate(SalaryItemObject value) {
		this.salaryItemPane.populate(value);
	}

	@Override
	public int showDialog(Component owner) {
		return this.showDialog(SwingUtilities.getWindowAncestor(owner), "薪酬项目", 410, 150);
	}

	@Override
	public SalaryItemObject update() {
		return this.salaryItemPane.update();
	}
}
